const elixir = require('laravel-elixir'),
    gulp = require('gulp'),
    uglify = require('gulp-uglify'),
    pump = require('pump');

require('laravel-elixir-vue-2');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for your application as well as publishing vendor resources.
 |
 */


let basejs = [
    'resources/assets/js/vendor/modernizr-2.8.3.min.js',
    'resources/assets/js/vendor/jquery-2.1.1.min.js',
    'resources/assets/js/vendor/localforage.min.js',
    'resources/assets/js/vendor/jquery.inline-attach.min.js',
    'resources/assets/js/vendor/bootstrap.min.js',
    'resources/assets/js/vendor/emojify.min.js',
    'resources/assets/js/vendor/jquery.nivo.slider.pack.js',
    'resources/assets/js/vendor/animsition.min.js',
    'resources/assets/js/vendor/jquery.textcomplete.js',
    'resources/assets/js/vendor/modernizr.custom..js',
    'resources/assets/js/vendor/notifications/snap.svg-min.js',
    'resources/assets/js/vendor/notifications/notificationFx.js',
    'resources/assets/js/vendor/emoji.js',
    'resources/assets/js/vendor/marked.min.js',
    'resources/assets/js/vendor/main.js'
];

elixir((mix) => {
    mix.scripts(basejs, 'public/assets/js/scripts.js', './');
});

gulp.task('compress', function (cb) {
    pump([
            gulp.src('public/assets/js/scripts.js'),
            uglify(),
            gulp.dest('public/assets/js/m/')
        ],
        cb
    );
});